package com.wlc.base.hashcodeandequal;

import java.util.Objects;

/**
 * @author 王立朝
 * @date 2022/3/10
 * @description:
 */
public class User1 {

    private String name;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        User1 user1 = (User1) o;
        return Objects.equals(name, user1.name);
    }



    public boolean checkHashCode(Object o1) {
        return this.hashCode() == o1.hashCode() ? true : false;
    }

    public User1() {
    }

    public User1(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
